﻿using System;
using System.Xml.Serialization;
using System.Collections;

namespace TheLogWatcher
{
    /// <summary>
    ///     Possible log format type settings are stored here.
    /// </summary>
    public class FormatConfigsType
    {
        public FormatConfigsType()
        {
        }

        public FormatConfigsType(string name, int x, int y, int defaultProperty, string text)
        {
            this.Name = name;
            this.X = x;
            this.Y = y;
            this.DefaultProperty = defaultProperty;
            this.Text = text;
        }

        /// <summary>
        ///     Unique name of the format type. E.g. "Hour", "Minute" (acts as ID).
        /// </summary>
        [XmlElementAttribute("Name")]
        public string Name;

        /// <summary>
        ///     The default x-position of the format type selection block.
        /// </summary>
        [XmlElementAttribute("X")]
        public int X;

        /// <summary>
        ///     The default y-position of the format type selection block.
        /// </summary>
        [XmlElementAttribute("Y")]
        public int Y;

        /// <summary>
        ///     Specifies the ID of the property that is used by default.
        /// </summary>
        [XmlElementAttribute("DefaultProperty")]
        public int DefaultProperty;

        /// <summary>
        ///     The default text that will be inserted as separator.
        /// </summary>
        [XmlElementAttribute("Text")]
        public string Text;

        /// <summary>
        ///     A list of all possible properties according to this format type.
        /// </summary>
        [XmlArray("Properties"), XmlArrayItem("Property", typeof(FormatConfigsTypeProperty))]
        public ArrayList Properties;
    }
}
